var mysql  = require('mysql')   
var connection = mysql.createConnection({     
  host     : 'localhost',       
  user     : 'root',              
  password : '123456',       
  port     : '3306',                   
  database : 'test' 
})  
connection.connect() 
var  addSql = 'insert into user(id,name,password,email,mobile) values(3,?,?,?,?)'
var  addSqlParams = ['chengong', '888','chen@163.com','22783828']
connection.query(addSql,addSqlParams,function (err, result) {
        if(err){
         console.log('[INSERT ERROR] - ',err.message)
         return
        }
       //console.log('insert id:',result.insertId)        
       console.log('insert id:',result)        
}) 
connection.end()